<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1">
    <title>html5 webapp 饼图 组件</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            background-color: #000;
            font-size: 12px;
        }
        .iphone {
            width: 340px;
            height: 540px;
            background-color: #fff;
            position: absolute;
            left: 50%;
            top: 50%;
            margin:-270px 0 0 -170px;
        }

    </style>
    <script src="../js/lib/jquery.js"></script>
    <script src = "../js/H5ComponentBase.js"></script>
    <link rel="stylesheet" href="../css/H5ComponentBase.css">
    <!--引入饼图资源-->
    <script src="../js/H5ComponentPie.js"></script>
    <link rel="stylesheet" href="../css/H5ComponentPie.css">


</head>
<body>
<!--用于开发测试 H5ComponentPie 对象（饼图组件）-->
<div class="iphone">

</div>

<script>
    var cfg = {
        type  : 'pie',
        width : 400,
        height: 400,
        data  : [
            ['JavaScript' , 0.25 , 'skyblue'],
            ['HTML/CSS' , 0.02 , 'green'],
            ['jQuery' , 0.38 , 'deeppink'],
            ['Bootstrap' , 0.2 ,'blue'],
            ['VueJS' , 0.15 ,'purple'],
//            ['AngularJS' , 0.05 , 'pink' ],
//            ['React' , 0.05 , 'red'],
//            ['webpack' , 0.1 , 'orange'],
        ],
        css   : {
            top : 100,
            opacity: 0
        },
        animateIn : {
            opacity: 1,
            top:200

        },
        animateOut : {
            opacity: 0,
            top:100
        },
        center : true, //为true时居中且上面的css中的位置样式无效
    }
    var h5 = new H5ComponentPie('myPieComponent',cfg);
    $('.iphone').append(h5);
    var leave = true;
    $('body').click(function () {
        leave = !leave;
        $('.h5_component').trigger(leave ? 'onLeave' : 'onLoad');
    }).click()
</script>


</body>

</html>